<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html" charset="utf-8"/>
    <title>文件上传</title>
    <script>
        function chk(){
            var fileurl = document.getElementById("file").value;
            document.getElementById("hid").value = fileurl;
        }
    </script>
</head>
<body>
    <form action="receivefile.php" method="post" enctype="multipart/form-data"   name="form1" id="form1" onsubmit="return chk()">
        <input type="file" name="filename" />
        <input type="hidden" name="hid" id="hid"/>
        <input type="submit" value="发送"/>
    </form>
</body>
</html>